package main

import "fmt"

//定义一个结构体类型
type Student struct {
	id   int
	name string
	sex  byte //字符类型
	age  int
	addr string
}

func main() {

	s1 := Student{1, "mike", 'm', 18, "beijin"}
	s2 := Student{1, "mike", 'm', 18, "beijin"}
	s3 := Student{2, "mike", 'm', 18, "beijin"}
	fmt.Println("s1 == s2", s1 == s2) // 比较 每个元素比较 ，结果体比较不能用 >或< 只能用 == 或 !=
	fmt.Println("s1 == s3", s1 == s3)

	//同类型的2个结构体变量可以相互赋值
	var tmp Student
	tmp = s3
	fmt.Println("tmp = ", tmp)
}
